﻿using Abp.Application.Services.Dto;
using DualControl.Common;
using DualControl.ControlMeasures;
using DualControl.EmergencyMeasures;
using System;
using System.Collections.Generic;
using System.Text;

namespace DualControl.RiskLibrary.Dtos
{
    public class HSNotificationListDto:EntityDto
    {

        //EntityDto中包含的Id为Hazardous的Id

        //风险点编码
        public string Code { get; set; }
        public int RiskPointId { get; set; }

        //风险点名称  用户能区别该风险点，建议用车间名+风险点名
        public string RiskPointName { get; set; }

        //所属部门
        public long OrganizationUnitId { get; set; }


        //风险源名称
        public string HazardSourceName { get; set; }

        //风险因素
        public string RiskFactor { get; set; }

        /// <summary>
        /// 事故类型
        /// </summary>
        public string AccidentTypes { get; set; }

        //将AccidentTypes字符串转换为枚举类型列表
        public List<AccidentType> AccidentTypesForView
        {

            get
            {
                string[] strarray;
                List<AccidentType> accidentlist = new List<AccidentType>();
                if (AccidentTypes.Length > 0)
                {
                    strarray = AccidentTypes.Split(" ");
                    foreach (var a in strarray)
                    {
                        accidentlist.Add((AccidentType)Convert.ToInt16(a));
                    }
                }
                return accidentlist;
            }
        }

        //
        /// <summary>
        /// 风险等级
        /// </summary>
        public RiskLevel? RiskLevel { get; set; }

        //管控措施列表
        public ICollection<ControlMeasure> ControlMeasures { get; set; }

        //应急措施列表
        public ICollection<EmergencyMeasure> EmergencyMeasures { get; set; }
    }
}
